module.exports = {
    //配置发布时的请求路径
    publicPath: process.env.NODE_ENV === "production" ? "./" : "/",
    outputDir: "dist",
    configureWebpack: config => {
        if (process.env.NODE_ENV === "production") {
            // 为生产环境修改配置...
            config.externals = {
                vue: "Vue",
                // vuex: "Vuex",
                "vue-router": "VueRouter"
            };
        } else {
            // 为开发环境修改配置...
        }
    },
    chainWebpack: config => {
        config.plugin("html").tap(args => {
            args[0].template = process.env.template;
            return args;
        });
    },
    //是否跨域
    devServer: {
      proxy: {
        '/data/*': {
            target: 'http://127.0.0.1:9005',
            changeOrigin: true,  //是否跨域
            pathRewrite: {
              '^/data': '/data'
            },
        '^/foo': {
          target: '<other_url>'
        }
      }
    }
  }
}